package xyz.renyumeng.xkm.order.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import xyz.renyumeng.xkm.dto.order.AdminOrderPage;
import xyz.renyumeng.xkm.dto.order.AdminOrderPageResult;
import xyz.renyumeng.xkm.model.order.OrderInfo;
import xyz.renyumeng.xkm.order.service.OrderService;
import xyz.renyumeng.xkm.result.Result;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author renyumeng
 * @date Created in 8:50 2023/6/30
 */


@RequestMapping("/admin/order")
@RestController
@Api(tags = "管理员用户订单接口")
public class AdminOrderController {

    @Resource
    private OrderService orderService;

    @PostMapping("/page")
    @ApiOperation(value = "分页模糊查询订单")
    public Result<AdminOrderPageResult> page(@RequestBody AdminOrderPage adminOrderPage) {
        return orderService.pageWithFilter(adminOrderPage);
    }

    @PostMapping("/inner/add")
    @ApiOperation(value = "内部接口增加一个订单数据")
    public Boolean innerAddOrder(@RequestBody OrderInfo orderInfo) {
        return orderService.innerAddOrder(orderInfo);
    }
}
